<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui" >
<h:head>
    <title>Helena Bolos</title>
    <link rel="stylesheet" type="text/css" href="util/style.css" media="screen" />
  </h:head>
  
<h:body>



<p:layout>


<p:layoutUnit position="north" size="100" header="Helena Bolos" resizable="true" closable="false" collapsible="false">  </p:layoutUnit>  
  
  <p:layoutUnit position="center" >  
        <h:form>  
        <h:graphicImage position="auto" value="https://fbcdn-sphotos-f-a.akamaihd.net/hphotos-ak-prn2/1374112_244337009049427_567382378_n.jpg" width="980px;" height="400px;"></h:graphicImage>
        </h:form>  
    </p:layoutUnit>  
    <p:layoutUnit position="south" size="100" header="Bottom" resizable="true" closable="true" collapsible="true">  
        <h:outputText value="South unit content." />  
    </p:layoutUnit>  
  
    <p:layoutUnit position="west" size="200" header="Redes Sociais" resizable="true" closable="false" collapsible="true" effect="drop">  <br/>
    <h:outputLink value="https://www.facebook.com/HelenaBolos.Salgados?fref=ts">
        <h:graphicImage value="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQb_8KZ2gQJyMpHug2Ax_RCGrJ49xcKEVFM70Ta2sGcyRu6PAo1" width="200px;"> </h:graphicImage>
        </h:outputLink>
    </p:layoutUnit>  
  
    <p:layoutUnit position="east" size="300"  header="Área Restrita" resizable="true" closable="false" collapsible="true" effect="drop">  
       <h:form id="form"> 
       
       
       <!-- codigos login --> 
    <h:outputLink id="loginLink" value="javascript:void(0)" onclick="PF('dlg').show()" title="login">   
        <p:graphicImage value="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcSiy6GPD-lazhGnDyPAgswv3-ZON8_kFSVqpgxkzPMirboDbhRS" />  
    </h:outputLink>  
    
  
    <p:growl id="growl" showDetail="true" life="3000" />  
  
    <p:dialog id="dialog" header="Login" widgetVar="dlg" resizable="false">  
  
        <h:panelGrid columns="2" cellpadding="5">  
            <h:outputLabel for="username" value="Username:" />  
            <p:inputText value="#{encomendaBean.login}"   
                    id="username"  required="true" label="Login" />  
              
            <h:outputLabel for="password" value="Password:" />  
            <h:inputSecret value="#{encomendaBean.senha}"   
                    id="password"  required="true" label="Senha" />  
              
            <f:facet name="footer">  
                <p:commandButton id="loginButton" value="Login" update="growl"   
                    action="#{encomendaBean.logar}"/> 
            </f:facet>  
        </h:panelGrid>  
          
    </p:dialog>  
    </h:form>  
    <h:form id="form2">
    <!-- comeca codigos do inscreva-se -->
    <h:outputLink id="inscreva-se" value="javascript:void(0)" onclick="PF('dlg2').show()" title="inscrevase">   
        <p:graphicImage value="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcTuyo8iesWJkcXzhbRWKASH1S7b0LDGyh9kwOxYCDx-SIO3As_k" />  
    </h:outputLink>
     <p:growl id="growl2" showDetail="true" life="3000" />  
  
    <p:dialog id="dialog2"  header="Cadastre-se" widgetVar="dlg2" resizable="false" showEffect="explode" hideEffect="fold" >  
  <!-- nome -->
        <h:panelGrid columns="2" cellpadding="5">  
            <h:outputLabel for="Nome" value="Nome" />  
            <p:inputText value="#{clienteBean.cliente.nome}"   
                    id="nome"   label="nome" />  
              
            <h:outputLabel for="cpf" value="cpf" />  
            <h:inputText value="#{clienteBean.cliente.cpf}"   
                    id="cpf"   label="cpf" />  
                    
                    <h:outputLabel for="Sexo:" value= "sexo" id="sexo"/>
             <p:selectOneMenu effect="explode" value="#{clienteBean.cliente.sexo}" >
             <f:selectItem itemLabel="Escolha o Sexo" itemValue="escolha o sexo" />
             <f:selectItem itemLabel="Masculino" itemValue="Masculino" /> 
             <f:selectItem itemLabel="Feminino" itemValue="Feminino" />  
             <f:selectItems>
             </f:selectItems>
             </p:selectOneMenu>
          

            <h:outputLabel for="Telefone" value="Telefone" />
            <p:inputText value="#{clienteBean.cliente.telefone}"   
                    id="Telefone"   label="telefone" />  
              
            <h:outputLabel for="Logradouro" value="Logradouro" />  
            <h:inputText value="#{clienteBean.endereco.logradouro}"   
                    id="logradouro"   label="Logradouro" /> 
                    
                     <h:outputLabel for="Bairro" value="Bairro" />  
            <p:inputText value="#{clienteBean.endereco.bairro}"   
                    id="bairro"   label="bairro" />  
              
            <h:outputLabel for="Cidade" value="cidade" />  
            <h:inputText value="#{clienteBean.endereco.cidade}"   
                    id="cidade"   label="cidade" /> 
                    <h:outputLabel for="Estado" value="estado" />  
               <p:selectOneMenu effect="fold" value="#{clienteBean.endereco.estado}" >
             <f:selectItem itemLabel="Escolha o estado" itemValue="escolha o estado" />
             <f:selectItem itemLabel="Acre" itemValue="Acre" /> 
             <f:selectItem itemLabel="Alagoas" itemValue="Alagoas" />
             <f:selectItem itemLabel="Amapá" itemValue="Amapá" />  
             <f:selectItem itemLabel="Amazonas" itemValue="Amazonas" />  
             <f:selectItem itemLabel="Bahia" itemValue="Bahia" /> 
             <f:selectItem itemLabel="Ceará" itemValue="Ceará" />  
             <f:selectItem itemLabel="Distrito Federal" itemValue="Distrito Federal" />
             <f:selectItem itemLabel="Espirito Santo" itemValue="Espiríto Santo" />
             <f:selectItem itemLabel="Goiás" itemValue="Goiás" />  
             <f:selectItem itemLabel="Maranhão" itemValue="Maranhão" />  
             <f:selectItem itemLabel="Mato Grosso" itemValue="Mato Grosso" />
             <f:selectItem itemLabel="Mato Grosso do Sul" itemValue="Mato Grosso do Sul" />  
             <f:selectItem itemLabel="Minas Gerais" itemValue="Minas Gerais" />
             <f:selectItem itemLabel="Paraíba" itemValue="Paraíba" />
             <f:selectItem itemLabel="Pernambuco" itemValue="Pernambuco" />
             <f:selectItem itemLabel="Piauí" itemValue="Piauí" />
             <f:selectItem itemLabel="Rio de Janeiro" itemValue="Rio de Janeiro" />
             <f:selectItem itemLabel="Rio Grande do Norte" itemValue="Rio Grande do Norte" />
             <f:selectItem itemLabel="Rio Grande do Sul" itemValue="Rio Grande do Sul" />
             <f:selectItem itemLabel="Rondônia" itemValue="Rio Grande do Sul" />
             <f:selectItem itemLabel="Rio Grande do Sul" itemValue="Rio Grande do Sul" />
             <f:selectItem itemLabel="Rondonia" itemValue="Rondonia" />
             <f:selectItem itemLabel="Roraima" itemValue="Rio Grande do Sul" />
             <f:selectItem itemLabel="Santa Catarina" itemValue="Santa Catarina" />
             <f:selectItem itemLabel="São Paulo" itemValue="São Paulo" />
             <f:selectItem itemLabel="Sergipe" itemValue="Sergipe" />
             <f:selectItem itemLabel="Tocantins" itemValue="Tocantins" />
             
            
             </p:selectOneMenu>
          
          <h:outputLabel for="login" value="login" />  
            <p:inputText value="#{clienteBean.cliente.login}"   
                    id="login"   label="login" />  
                     <h:outputLabel for="senha" value="Senha" /> 
                      
            <h:inputSecret value="#{clienteBean.cliente.senha}"   
                    id="senha"   label="senha" />
                      
                    <!--fim dos itens form -->
            <f:facet name="footer">  
                <p:commandButton id="increvabutton" value="Cadastrar" update="growl2"   
                    action="#{clienteBean.salvar}" 
                     oncomplete="handleLoginRequest2(xhr, status, args)"  />
                   
            </f:facet>  
        </h:panelGrid>  
          
    </p:dialog>    
    </h:form>

  
<script type="text/javascript">  
    function handleLoginRequest(xhr, status, args) {  
        if(args.validationFailed || !args.loggedIn) {  
            PF('dlg').jq.effect("shake", { times:5 }, 100);  
        }   
        else {  
            PF('dlg').hide();  
            $('#loginLink').fadeOut();  
        }  
    }  
</script>   
<script type="text/javascript">  
    function handleLoginRequest2(xhr, status, args) {  
        if(args.validationFailed || args.cadastrou) {  
            PF('dlg2').hide();  
            $('#cadastrou').fadeOut();  
         
          	
          	  
          
        }  
    }  
</script>  
    </p:layoutUnit>  
  
    
  

</p:layout>






  </h:body>
</html>